import React from 'react';
import PropTypes from 'proptypes';
import B from './B';

class A extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
            username: 'Zxk'
        };
    }
    render() {
        return <div>
            Component A;
            <B />
            <hr />
            {/* <D /> */}
        </div>
    }
    getChildContext() {
        return {
            username: this.state.username
        };
    }
}
A.childContextTypes = {
    username: PropTypes.string
}
export default A;